import { Column, Entity, PrimaryGeneratedColumn, BaseEntity, CreateDateColumn, UpdateDateColumn, OneToMany, } from 'typeorm';
import { RoleAdmin } from './roleAdmin.entity';
@Entity()
export class Admin extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;
  @Column()
  account: string;
  @Column()
  nickname: string;
  @Column()
  mobile: string;
  @Column()
  password: string;
  @Column()
  salt: string;
  @Column('int')
  departmentId: number;
  @Column('tinyint')
  status: number;
  @Column()
  lastLoginIp: string;
  @Column()
  lastLoginTime: string;
  @CreateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  createTime: Date;
  @UpdateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  updateTime: Date;
  @OneToMany(() => RoleAdmin, roleAdmin => roleAdmin.admin)
  roleAdmin: RoleAdmin[];
}
